/*
 *    Copyright © OpenAtom Foundation.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package com.inspur.edp.bef.dtgenerator.api.mgrInterface.resourceInfo;

import com.inspur.edp.bef.api.be.BEInfo;
import com.inspur.edp.bef.bizentity.GspBusinessEntity;
import com.inspur.edp.bef.spi.entity.builtinimpls.BefModelResInfoImpl;
import com.inspur.edp.cef.generator.apiGenerator.CefApiGeneratorContext;
import com.inspur.edp.cef.generator.apiGenerator.dataType.mgrInterface.MgrInterfaceGeneratorContext;
import com.inspur.edp.cef.generator.apiGenerator.dataType.mgrInterface.resourceInfo.ModelInfoCtorGenerator;
import com.inspur.edp.cef.generator.apiGenerator.dataType.mgrInterface.resourceInfo.ModelInfoGenerator;
import com.inspur.edp.das.commonmodel.entity.GspCommonModel;

public class BefModelInfoGenerator extends ModelInfoGenerator {

    private final CefApiGeneratorContext parentContext;
    private GspCommonModel model;

    public BefModelInfoGenerator(CefApiGeneratorContext parentContext, GspCommonModel model) {
        super(parentContext, model);
        this.parentContext = parentContext;
        this.model = model;
    }

    @Override
    protected Class getParentClassType() {
        return BefModelResInfoImpl.class;
    }

    @Override
    protected ModelInfoCtorGenerator getModelInfoCtorGenerator() {
        return new BefModelInfoConstructorGenerator(this.getName(), this.getMetaCurrentSU(), this.getMetaResourceMetaId(),(GspBusinessEntity)model, this.getModelRootNodeCode(), this.getModelDisplayValueKey(), this.parentContext
        ,((GspBusinessEntity)model).getDataLockType());
    }
}
